﻿using AutoMapper;
using Domain;
using Rabbit.API.Application.Command.Breed;
using Rabbit.API.Application.Command.FinishStep;
using Rabbit.API.Application.Command.Goods;
using Rabbit.API.Application.Command.Kill;
using Rabbit.API.Application.Handler.Goods;
using Rabbit.API.DTOs;

namespace Rabbit.API
{
    /// <summary>
    /// 指定映射关系
    /// </summary>
    public class AutomapperFiles:Profile
    {
        public AutomapperFiles()
        {
            //用户
            CreateMap<UserModel, LoginDTO>();
            // GoodsAddCommand->GoodsModel
            //商品添加
            CreateMap<GoodsAddCommand, GoodsModel>();
            //商品显示+商品详情
            CreateMap<GoodsModel, GoodsDTO>();
            //养殖信息修改
            CreateMap<BreedUpdateCommand, BreedModel>();
            //屠宰详情
            CreateMap<KillModel, KillDTO>();
            //屠宰表修改
            CreateMap<KillUpdateCommand, KillModel>();
            //深加工表详情
            CreateMap<FinishStepModel, FinishStepDTO>();
            //深加工修改
            CreateMap<FinishStepUpdateCommand, FinishStepModel>();

            CreateMap<GoodsGetAllDataHandler, GoodsModel>();
        }
    }
}
